<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<title>通讯录</title>
<body>
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
$link = mysql_connect('localhost','root','xbsmpasswd') or die(mysql_error());// 建立连接
mysql_select_db('wechat',$link);// 选择数据库
mysql_query('set names utf8');// 设定连接编码
$sql = "SELECT * FROM mail_list";// 定义sql语句
$rs = mysql_query($sql);
?>
<div align="center">
  <p class="STYLE1" style="font-size:24px;color:black;">通讯录</p><br /><br />
  <form method="post" action="search.php" name="search">
  <input name="search" type="text" size="15" />姓名索搜
  </form>
  <br />
 <table width="580" height="100" border="0">
 
 <tr>
 <th>编号</th><th>姓名</th><th>电话</th><th>职位</th><th>部门</th><th>板块</th>
 <th colspan="3"><input type="button" value="添加" onclick="location.href='add2.php'" />操作</th>
 <?php
    while($rows=mysql_fetch_assoc($rs))
 {
 ?>
    <tr>
    <td><?php echo $rows['id']; ?></td>
    <td><?php echo $rows['name'] ?></td>
    <td><?php echo $rows['phone'] ?></td>
    <td><?php echo $rows['position'] ?></td>
         <td><?php echo $rows['department'] ?></td>
         <td><?php echo $rows['plate'] ?></td>
    <td><a href="modify.php?id=<?php echo $rows['id']; ?>">修改</a></td>
    <td><a href="del.php?id=<?php echo $rows['id']; ?>" onclick="return confirm('确定要删除吗?')">删除</a></td>
    </tr>
    
 <?php 
 }
 ?>
 
 </tr>
 </table>
</div>

</body>
</html>